//
//  EGSingleRoundView.m
//  MotionLaunchDemo
//
//  Created by 程登伟 on 16/9/14.
//  Copyright © 2016年 程登伟. All rights reserved.
//

#import "EGMotionItemView.h"

@interface EGMotionItemView ()

@property (nonatomic, strong)UIView *solidCircle;

@end

@implementation EGMotionItemView


- (void)drawRect:(CGRect)rect {
    
    CGContextRef contextRef = UIGraphicsGetCurrentContext();
    CGContextSetLineWidth(contextRef, 1);
    CGRect frame = rect;
    frame.origin.x += 1;
    frame.origin.y += 1;
    frame.size.width -= 2;
    frame.size.height -= 2;
    CGContextAddEllipseInRect(contextRef, frame);
    [[UIColor blueColor] set];
    CGContextStrokePath(contextRef);
    
}



- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {

        [self setContentView];
        self.backgroundColor = [UIColor clearColor];

    }
    return self;
}


-(void)setContentView{

    CGRect frame = self.frame;
    frame.origin.x = self.frame.size.width/4.0;
    frame.origin.y = self.frame.size.height/4.0;
    frame.size.width = self.frame.size.width/2.0;
    frame.size.height = self.frame.size.height/2.0;
    self.solidCircle = [[UIView alloc] initWithFrame:frame];
    self.solidCircle.backgroundColor = [UIColor blueColor];
    self.solidCircle.layer.cornerRadius = frame.size.width/2.0;
    self.solidCircle.layer.masksToBounds = YES;
    self.solidCircle.hidden = YES;
    [self addSubview:self.solidCircle];
    
}

-(void)hideSoildCircle:(BOOL)hidden{
    self.solidCircle.hidden = hidden;
}




@end
